using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLCG.DAO
{
public class tblTieuLinhVucChuyenGiaUI
{ 
	private int idTieuLinhVucChuyenGia;
	public int IdTieuLinhVucChuyenGia
	{
		get { return idTieuLinhVucChuyenGia;}
		set { idTieuLinhVucChuyenGia = value;}
	}

	private int idChuyenGia;
	public int IdChuyenGia
	{
		get { return idChuyenGia;}
		set { idChuyenGia = value;}
	}

	private int idTieuLinhVuc;
	public int IdTieuLinhVuc
	{
		get { return idTieuLinhVuc;}
		set { idTieuLinhVuc = value;}
	}

	public tblTieuLinhVucChuyenGiaUI() {}

	public tblTieuLinhVucChuyenGiaUI(int idTieuLinhVucChuyenGia, int idChuyenGia, int idTieuLinhVuc)
	 {
		this.idTieuLinhVucChuyenGia = idTieuLinhVucChuyenGia;
 		this.idChuyenGia = idChuyenGia;
 		this.idTieuLinhVuc = idTieuLinhVuc;
 	}

	public int Add(int idChuyenGia, int idTieuLinhVuc)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblTieuLinhVucChuyenGia_Add",idChuyenGia,idTieuLinhVuc);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int idTieuLinhVucChuyenGia, int idChuyenGia, int idTieuLinhVuc)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblTieuLinhVucChuyenGia_Update",idTieuLinhVucChuyenGia,idChuyenGia,idTieuLinhVuc);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idTieuLinhVucChuyenGia)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblTieuLinhVucChuyenGia_Delete",idTieuLinhVucChuyenGia);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblTieuLinhVucChuyenGia_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idTieuLinhVucChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblTieuLinhVucChuyenGia_Get",idTieuLinhVucChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblTieuLinhVucChuyenGia_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdChuyenGia(int idChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblTieuLinhVucChuyenGia_GetByIdChuyenGia",idChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdTieuLinhVuc(int idTieuLinhVuc)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblTieuLinhVucChuyenGia_GetByIdTieuLinhVuc",idTieuLinhVuc);
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
